<%-- 
    Document   : result
    Created on : Jun 24, 2011, 12:01:34 AM
    Author     : esaheki
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page import="br.unesp.demac.bcc.soo.clarus.bean.Obra" %>
<%@page import="br.unesp.demac.bcc.soo.clarus.bean.Autor" %>
<jsp:useBean id="obras" scope="session" class="java.util.List<Obra>" />


<!-- Header -->
<c:import url="/include/header.jsp">
    <c:param name="title" value="Clarus - Resultado da Pesquisa" />
</c:import>
<!-- Header -->
<%
if (session.getAttribute("aluno") == null || session.getAttribute("aluno").equals("")) {
    response.sendRedirect("index.jsp");
}
%>

<div class="colmask leftmenu"><div class="colright"><div class="col2">

    <!-- Menu -->
    <c:import url="/menu.jsp" />
    <!-- Menu -->

    </div><div class="col1wrap"><div class="col1">

    <!-- Content -->

    <h2>Resultados</h2>
    <p>Entrada de dados</p>
    <table class="tdResult">
    <tr class="tdheader">
        <td class="tdTitulo">Título</td>
        <td class="tdAutor">Autor</td>
        <td class="tdOpcoes" width="145px" align="center">Opções</td>
    </tr>
    
    <%
        int i = 0;
        for (Obra obra : obras) {
            String style = (i % 2 == 0) ? "even" : "odd";
    %>
    <tr class="<%=style%>">
        <td class="tdTitulo"><a class="greenlink" href="ObraServlet?idObra=<%=obra.getIdObra()%>"><%=obra.getNomeObra()%></a></td>
        <td class="tdAutor"><%=obra.autoresToString()%></td>
        <td class="tdOpcoes" align="center">
            <a class="greenlink" href="ObraServlet?idObra=<%=obra.getIdObra()%>">Detalhes</a> | 
            <a class="redlink" href="index.jsp">Reservar</a>
        </td>
    </tr>
    <%
        i++;
        }
    %>
    </table>

    <!-- Content -->

</div></div></div></div>

<!-- Footer -->
<c:import url="/include/footer.jsp" />
<!-- Footer -->